// export const BASE_URL = 'http://192.168.244.1:8000'   //App
// export const BASE_URL = 'http://localhost:8000/'
export const BASE_URL='/filmAPI'  //H5

const myRequest=(options:any)=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			url:BASE_URL+options.url,
			method:options.method||'GET',
			data:options.data||{},
			success:(res)=>{
				if(res.data.code!==0){
					return uni.showToast({
						icon:'error',
						title:res.data.Message
					})
				}
				resolve(res)
			},
			fail: (err) => {
				uni.showToast({
					title:'请求接口失败'
				})
				reject(err)
			}
		})
	})
}

export default{
	myRequest,
}